/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sistemPembayaranSPP;

import java.util.ArrayList;
import java.util.List;
import javax.swing.table.AbstractTableModel;

/**
 *
 * @author w7
 */
public class LaporanTableModel extends AbstractTableModel {

    private List<Pembayaran> k = new ArrayList<Pembayaran>();
 //   Double saldoSesudah = 0.00;

    public LaporanTableModel(List<Pembayaran> k) {
        this.k = k;
    }

    public int getRowCount() {
        return k.size();
    }

    public int getColumnCount() {
        return 6;
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        Pembayaran kat = k.get(rowIndex);
        switch (columnIndex) {
            case 0:
                return kat.getTanggalBayar();
            case 1:
                return kat.getNIS();
            case 2:
                return kat.getNamaKelas();
//            case 3:
//                return kat.getTotalBayar();
            case 3:
                return kat.getDibayar();
            case 4:
                return kat.getKembali();
//            case 6:
//                return kat.getSaldo();
            default:
                return "";
        }
    }

    @Override
    public String getColumnName(int column) {
        switch (column) {
            case 0:
                return "TANGGAL";
            case 1:
                return "NIS";
            case 2:
                return "NAMAKELAS";
//            case 3:
//                return "TOTALBAYAR PER TAHUN";
            case 3:
                return "DIBAYAR";
            case 4:
                return "SALDO SISWA";
//            case 6:
//                return "SALDO PER BULAN";
            default:
                return "";
        }
    }
}
